﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nature;
using Nature.Toolkit.GKin;

public static class Extensions
{
    public static IdealGasMixtureTimeAdapter CreateUVAutoIgnitionAdapter(this ICombustionSuitFactory factory)
    {
        return new IdealGasMixtureTimeAdapter(factory.CreateUVAutoIgnitionController());
    }

    public static double AbsMax(this ReadOnlyArray<double> array)
    {
        double amax = Math.Abs(array[0]);
        for (int i = 1; i < array.Length; ++i)
        {
            double tmp = Math.Abs(array[i]);
            if (amax < tmp) { amax = tmp; }
        }
        return amax;
    }
}
